package cn.wx.shop.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.wx.shop.dao.CategoryDao;
import cn.wx.shop.entity.Category;

/**
 * 分类管理业务处理
 * @author acer
 *
 */
@Service
public class CategoryService {

	@Autowired
	CategoryDao categoryDao;

	public List<Category> categoryByParentId( Integer parentId){
		return categoryDao.categoryByParentId(parentId);
	}
	public List<Category> categorys(){
		return categoryDao.categorys();
	}
	
	public int addCategory(Category category){
		return categoryDao.addCategory(category);
	}
	public Integer delCategory(Integer id) {

		return categoryDao.delCategory(id);
	}
	
	public Category selectById(Integer id){
		return categoryDao.selectById(id);
	}
}
